<template>
  <el-container class="box">
    <el-header>
      <div class="logo">
        <img src="../../assets/images/jytb.png" alt />
        益博教育
      </div>
      <div class="right-nav">
        <img src="../../assets/images/wenhao.png" alt />
        <div class="help">帮助</div>
        <div class="exit" @click="tc">退出</div>
      </div>
      <div class="right">
        <div class="search">
          <input
            type="text"
            placeholder="您好，欢迎你来到后台管理系统！"
            class="nr"
          />

          <img src="../../assets/images/fangda.png" alt />
        </div>
      </div>
    </el-header>
    <el-container>
      <el-aside>
        <div class="tx">
          <img src="../../assets/images/user.png" alt c />
        </div>
        <p class="gly">管理员</p>
        <div class="left-nav">
          <el-menu class="el-menu-vertical-demo" router>
            <el-sub-menu class="first" index="/index/child">
              <template #title>
                <img src="../../assets/images/home.png" alt class="small" />
                <router-link to="/index">首页</router-link>
              </template>
            </el-sub-menu>
            <el-sub-menu class="second" index="/personal/child">
              <template #title>
                <img src="../../assets/images/grsz.png" alt class="small" />
                <router-link to="/personal">个人设置</router-link>
              </template>
            </el-sub-menu>
            <el-sub-menu index="/user">
              <template #title>
                <img src="../../assets/images/yhgl.png" alt class="small" />
                用户管理
              </template>
              <el-menu-item-group>
                <el-menu-item index="/user/jszh">教师账号</el-menu-item>
                <el-menu-item index="/user/xszh">学生账号</el-menu-item>
                <el-menu-item index="/user/kfzh">客服账号</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
            <el-sub-menu index="/edu">
              <template #title>
                <img src="../../assets/images/jwgl.png" alt class="small" />
                教务管理
              </template>
              <el-menu-item-group>
                <el-menu-item index="/edu/kcgl">课程管理</el-menu-item>
                <el-menu-item index="/edu/mxjs">明星讲师</el-menu-item>
                <el-menu-item index="/edu/jskq">教师考勤</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
            <el-sub-menu index="/stu">
              <template #title>
                <img src="../../assets/images/xsfw.png" alt class="small" />
                学生服务
              </template>
              <el-menu-item-group>
                <el-menu-item index="/stu/kcjs">课程介绍</el-menu-item>
                <el-menu-item index="/stu/zxkf">在线客服</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
            <el-sub-menu index="/order">
              <template #title>
                <img src="../../assets/images/ddgl.png" alt class="small" />
                订单管理
              </template>
              <el-menu-item-group>
                <el-menu-item index="/order/kcdd">课程订单</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
            <el-sub-menu index="/message">
              <template #title>
                <img src="../../assets/images/xtxx.png" alt class="small" />
                系统消息
              </template>
              <el-menu-item-group>
                <el-menu-item index="/message/czrz">操作日志</el-menu-item>
                <el-menu-item index="/message/xxtz">消息统治</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
          </el-menu>
        </div>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import { useRouter } from "vue-router";
import {
  ElContainer,
  ElAside,
  ElHeader,
  ElMain,
  ElSubMenu,
  ElMenuItemGroup,
  ElMenuItem,
  ElMenu,
} from "element-plus";

export default {
  setup() {
    const router = useRouter();
    const tc = () => {
      localStorage.clear();
      router.push({
        path: "/login",
      });
    };
    return {
      tc,
    };
  },
  components: {
    "el-container": ElContainer,
    "el-header": ElHeader,
    "el-aside": ElAside,
    "el-main": ElMain,
    "el-sub-menu": ElSubMenu,
    // "el-icon": ElIcon,
    "el-menu-item-group": ElMenuItemGroup,
    "el-menu-item": ElMenuItem,
    "el-menu": ElMenu,
  },
};
</script>

<style lang="less" scoped>
.el-container {
  height: 100%;
}
.el-header {
  background: #457dfb;
  height: 88px;
  color: #ffffff;
  line-height: 88px;

  .logo {
    font-size: 24px;
    width: 120px;
    height: 88px;
    float: left;
  }
  img {
    vertical-align: middle;
  }
}

.el-aside {
  background: #fff;
  width: 232px;
  overflow: hidden;
}

.el-main {
  background: #f7f7f7;
}
.right {
  height: 88px;
  float: right;
  margin-right: 40px;
  .search {
    width: 100%;
    height: 40px;
    background: #ffffff;
    border: 1px solid #c5c4c4;
    border-radius: 20px;
    line-height: 40px;
    transform: translateY(50%);
    .nr {
      width: 360px;
      height: 40px;
      border-radius: 20px;
      font-size: 18px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #7c7c7d;
      opacity: 0.5;
      margin-left: 45px;
      border: none;
    }
    .small {
      float: right;
      transform: translateY(-50%);
      margin-right: 35px;
    }

    img {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      cursor: pointer;
    }
  }
}
.right-nav {
  float: right;
  height: 88px;
  line-height: 88px;
  margin-top: -6px;
  img {
    margin-top: -3px;
  }
  .help,
  .exit {
    display: inline-block;
    width: 43px;
    height: 18px;
    font-size: 20px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #ffffff;
    margin-left: 8px;
    cursor: pointer;
  }
}
// aside
.tx {
  width: 232px;
  height: 147px;
  background: linear-gradient(0deg, #598cff, #437ef4);
  border-radius: 0px 0px 116px 116px;
  position: relative;
  img {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }
}
.gly {
  height: 20px;
  font-size: 20px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #333333;
  line-height: 15px;
  text-align: center;
  margin-top: 4px;
}

.left-nav {
  margin-top: 11px;

  .small {
    position: absolute;
    left: 30px;
  }
  .xiala {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
  }
}
.el-menu {
  width: 232px;
  /deep/.el-sub-menu__title {
    justify-content: center;
  }
  .el-menu-item {
    justify-content: flex-end;
  }
}
.first,
.second {
  /deep/.icon {
    display: none;
  }
}

// th的padding
/deep/.el-table th.el-table__cell {
  background: #f7f7f7;
  padding: 0;
}
// margintop
/deep/.el-table__inner-wrapper {
  margin-top: 8px;
}
// th 背景色
/deep/.el-table--fit {
  background: #f7f7f7;
}
</style>
